<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class FansSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $users = User::all();
        $user = User::query()->first();


        $fans = $users->slice(1);
        $fan_ids = $fans->pluck('id')->toArray();

        $user->fan($fan_ids);

        foreach ($fans as $fan) {
            $fan->fan($user->id);
        }


    }
}
